package com.wangdao.wechatmall.service.wx;

import com.github.pagehelper.PageHelper;
import com.wangdao.wechatmall.bean.pojo.Footprint;
import com.wangdao.wechatmall.bean.vo.wx.dto.FootprintListDTO;
import com.wangdao.wechatmall.mapper.FootprintMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * WXFootprintListServiceImpl
 * created by feng on 7/12/21
 */


@Service
public class WXFootprintListServiceImpl implements WXFootprintListService{

    @Autowired
    FootprintMapper footprintMapper;

    @Override
    public List<FootprintListDTO> selectFootprintList(Integer page, Integer size) {


        List<FootprintListDTO> footprintsList = footprintMapper.selectFootprintList();

        return footprintsList;
    }

    @Override
    public Integer delete(Integer id) {
        Footprint footprint = new Footprint();
        footprint.setId(id);
        footprint.setDeleted(true);

        int affectedRow = footprintMapper.updateByPrimaryKeySelective(footprint);
        return affectedRow;
    }
}